# only works with the Java extension of yacc: 
# byacc/j from http://troi.lincom-asg.com/~rjamison/byacc/

BINDIR = bin
DTDIR = dt

include Makefile.common

.PHONY: clean all frontend daytrader testfrontend revert compile

all: frontend daytrader

frontend: daytrader
	cd src/frontend && make

daytrader:
	cd src && make

clean:
	rm -f src/frontend/Parser.java src/frontend/Lexer.java
	rm -rf $(BINDIR)/frontend y.output
	rm -rf $(BINDIR)/daytrader y.output

run: compile
	make
	cd $(BINDIR) && java daytrader/framework/App -c ../userdata/user.config -d ../userdata/datapath -o ../userdata/observelist

compile: frontend
	cd $(BINDIR) && java frontend/Compiler -d ../src/daytrader/strategy --data-path ../userdata/datapath ../$(DTDIR)/hello.dt

revert: clean
	svn revert src/daytrader/strategy/*.java
	svn revert Makefile

include Makefile.test
